package edu.cuit.avatar;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/4 10:05
 */
public class CircleTest {
    public static void main(String[] args) {
        Circle circle1 = new Circle(1);
        //使用对象操作符.访问对象成员
        //circle1.radius = 1;
        System.out.println("半径为1的圆的面积:" + circle1.getArea() + ";周长:" + circle1.getPerimeter());
        Circle circle2 = new Circle(25);
        //circle2.radius = 25;
        System.out.println("半径为25的圆的面积:" + circle2.getArea() + ";周长:" + circle2.getPerimeter());
        Circle circle3 = new Circle(); //调用无参构造方法
        circle3.setRadius(125);
        System.out.println("半径为125的圆的面积:" + circle3.getArea() + ";周长:" + circle3.getPerimeter());

        printCircle(5, circle2);

        boolean result = circle2.equalsArea(circle3);
        System.out.println(result);
    }

    public static void printCircle(int count, Circle circle){
        for(int i = 0; i < count; i++){
            System.out.printf("radius: %.2f; area: %.2f; perimeter: %.2f\r\n", circle.getRadius(), circle.getArea(), circle.getPerimeter());
        }
    }
}
